tr
  td
    strong style="font-size: 75%"
      = web_hook.url
    p
      - if web_hook.upload_events == 1
        span.badge.bg-light-gray
          = t('simple_form.labels.web_hook.upload_events')
      - if web_hook.download_events == 1
        span.badge.bg-light-gray
          = t('simple_form.labels.web_hook.download_events')
      - if web_hook.changelog_events == 1
        span.badge.bg-light-gray
          = t('simple_form.labels.web_hook.changelog_events')
  td style="width: 140px"
    - web_hook.channels.all.each do |shared_channel|
      span.badge.bg-light-gray
        - if shared_channel == current_channel
          = t('web_hooks.current_channel')
        - else
          = link_to shared_channel.app_name, friendly_channel_overview_path(shared_channel)

  - unless @channel.app.archived
    td style="width: 70px"
      - if type == :enabled
        .btn-group-vertical
          .dropdown
            button.btn.btn-sm.btn-outline-secondary.dropdown-toggle.rounded-0.rounded-top [
                data-bs-toggle="dropdown"
                data-bs-title="#{t('web_hooks.test')}"
              ]
              i.fa-solid.fa-bullhorn
            ul.dropdown-menu
              li
                a.dropdown-item href="#{test_channel_web_hook_path(@channel, web_hook, 'upload_events')}"
                  = t('simple_form.labels.web_hook.upload_events')
              li
                a.dropdown-item href="#{test_channel_web_hook_path(@channel, web_hook, 'download_events')}"
                  = t('simple_form.labels.web_hook.download_events')
              li
                a.dropdown-item href="#{test_channel_web_hook_path(@channel, web_hook, 'changelog_events')}"
                  = t('simple_form.labels.web_hook.changelog_events')

          - if web_hook.channels_count == 1
            = button_link_to '', channel_web_hook_path(@channel, web_hook), 'trash-alt', \
              class: 'btn btn-sm btn-danger rounded-0 rounded-bottom', title: t('web_hooks.destroy'), \
              data: { turbo_method: :delete, turbo_confirm: t('modals.confirm.body'), bs_toggle: :tooltip, bs_custom_class: 'default-tooltip', bs_placement: 'bottom' }
          - else
            a.btn.btn-sm.btn-warning.rounded-0.rounded-bottom data-bs-toggle="tooltip" data-bs-custom-class="default-tooltip" data-bs-placement="bottom" title="#{t('web_hooks.disable')}" href="#{disable_channel_web_hook_path(@channel, web_hook)}"
              i.fa-solid.fa-link-slash
      - elsif type == :shared
        a.btn.btn-sm.btn-outline-secondary del="nofollow" data-bs-toggle="tooltip" data-bs-custom-class="default-tooltip" data-bs-placement="bottom" title="#{t('web_hooks.enable')}" href="#{enable_channel_web_hook_path(@channel, web_hook)}"
          i.fa-solid.fa-link
